#include<iostream>
using namespace std;
int lowbit(int n)
{
	return n & (-n);
}
int main()
{
	int n;
	cin >> n;
	int count = 0;
	while (n) {
		count++;
		n -= lowbit(n);
	}
	cout << count << endl;
	return 0;
}